package com.byb.server.service;

import com.byb.server.domain.Rate;
import com.byb.server.service.dto.Product_sort;
import com.byb.server.service.dto.RateDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

/**
 * Service Interface for managing Rate.
 */
public interface RateService {

    /**
     * Save a rate.
     *
     * @param rateDTO the entity to save
     * @return the persisted entity
     */
    RateDTO save(RateDTO rateDTO);

    /**
     *  Get all the rates.
     *
     *  @param pageable the pagination information
     *  @return the list of entities
     */
    Page<RateDTO> findAll(Pageable pageable);

    /**
     *  Get the "id" rate.
     *
     *  @param id the id of the entity
     *  @return the entity
     */
    RateDTO findOne(Long id);

    /**
     *  Delete the "id" rate.
     *
     *  @param id the id of the entity
     */
    void delete(Long id);

    /**
     * Search for the rate corresponding to the query.
     *
     *  @param query the query of the search
     *
     *  @param pageable the pagination information
     *  @return the list of entities
     */
    Page<RateDTO> search(String query, Pageable pageable);

    /**
     *  Get all the rates for sort.
     *
     *  @param pageable the pagination information
     *  @return the list of entities
     */
    Page<Product_sort> sort(String age, Integer premiumPaymentPeriod, String sexName, Pageable pageable);

    List<Product_sort> sortByState(Integer orderByState, List<Product_sort> page, Integer payment, Collection<Long> query, Pageable pageable);

    List<Product_sort> sortRank( String age,  Integer premiumPaymentPeriod,  String sexName,  Integer payment,  Integer orderByState,  String query, Pageable pageable);

    boolean saves(List<RateDTO> list);
}
